<template>
  <div :class="classes" :lay-allowClose="allwoClass">    
    <slot></slot>
  </div>
</template>

<script>
import { oneOf } from "../../utils/assist";
import element from "../element";

const prefixCls = "layui-tab";
export default {
  name: "Tabs",
  props: {
    type: {
      type: String,
      validator(value) {
        return oneOf(value, ["brief", "card"]);
      }
    },
    allwoClass: Boolean
  },
  computed: {
    classes() {
      return [
        prefixCls,
        {
          [`${prefixCls}-${this.type}`]: !!this.type
        }
      ];
    }
  },
  updated() {
    this.$nextTick(() => {
      element.render("tab");
    });
  }
};
</script>

<style scoped>

</style>